# i n c l u d e < i o s t r e a m > 
 
 # i n c l u d e < i o m a n i p > 
 
 u s i n g   n a m e s p a c e   s t d ; 
 
 v o i d   n h a p ( f l o a t   a [ ] [ 1 0 0 ] , i n t   & n ) ; 
 
 v o i d   x u a t ( f l o a t   a [ ] [ 1 0 0 ] , i n t   n ) ; 
 
 f l o a t   d e t ( f l o a t   a [ ] [ 1 0 0 ] , i n t   n ) ; 
 
 f l o a t   c o n ( f l o a t   a [ ] [ 1 0 0 ] , i n t   n , i n t   h , i n t   c ) ; 
 
 v o i d   n g h i c h d a o ( f l o a t   a [ ] [ 1 0 0 ] , i n t   n ) ; 
 
 v o i d   m a i n ( ) 
 
 { 
 
   f l o a t   a [ 1 0 0 ] [ 1 0 0 ] ; 
 
   i n t   n ; 
 
   n h a p ( a , n ) ; 
 
   x u a t ( a , n ) ; 
 
   c o u t < < " \ n - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ n m a   t r a n   n g h i c h   d a o : \ n " ; 
 
   n g h i c h d a o ( a , n ) ; 
 
   s y s t e m ( " p a u s e " ) ; 
 
 } 
 
 v o i d   n h a p ( f l o a t   a [ ] [ 1 0 0 ] , i n t   & n ) 
 
 { 
 
   c o u t < < " \ n n h a p   N =   " ; 
 
   c i n > > n ; 
 
   f o r ( i n t   i = 0 ; i < n ; i + + ) 
 
   { 
 
     c o u t < < " \ n n h a p   h a n g   " < < i + 1 < < " : \ n " ; 
 
     f o r ( i n t   j = 0 ; j < n ; j + + ) 
 
       c i n > > a [ i ] [ j ] ; 
 
   } 
 
 } 
 
 v o i d   x u a t ( f l o a t   a [ ] [ 1 0 0 ] , i n t   n ) 
 
 { 
 
   f o r ( i n t   i = 0 ; i < n ; i + + ) 
 
   { 
 
     c o u t < < " \ n \ n " ; 
 
     f o r ( i n t   j = 0 ; j < n ; j + + ) 
 
       c o u t < < s e t w ( 6 ) < < a [ i ] [ j ] ; 
 
   } 
 
 } 
 
 f l o a t   d e t ( f l o a t   a [ ] [ 1 0 0 ] , i n t   n ) 
 
 { 
 
   i n t   i , j , k , d e m = 0 , k t ; 
 
   f l o a t   b [ 1 0 0 ] , h , k q = 1 ; 
 
   f o r ( i = 0 ; i < n - 1 ; i + + ) 
 
   { 
 
     i f ( a [ i ] [ i ] = = 0 ) 
 
     { 
 
       k t = 0 ; 
 
       f o r ( j = i + 1 ; j < n ; j + + ) 
 
       { 
 
         i f ( a [ i ] [ j ] ! = 0 ) 
 
         { 
 
           f o r ( k = 0 ; k < n ; k + + ) 
 
           { 
 
             f l o a t   t = a [ k ] [ i ] ; 
 
             a [ k ] [ i ] = a [ k ] [ j ] ; 
 
             a [ k ] [ j ] = t ; 
 
           } 
 
           d e m + + ; k t + + ; 
 
           b r e a k ; 
 
         } 
 
       } 
 
       i f ( k t = = 0 )   r e t u r n   0 ; 
 
     } 
 
     b [ i ] = a [ i ] [ i ] ; 
 
     f o r ( j = 0 ; j < n ; j + + )   a [ i ] [ j ] / = b [ i ] ; 
 
     f o r ( j = i + 1 ; j < n ; j + + ) 
 
     { 
 
       h = a [ j ] [ i ] ; 
 
       f o r ( k = 0 ; k < n ; k + + )   a [ j ] [ k ] = a [ j ] [ k ] - h * a [ i ] [ k ] ; 
 
     } 
 
   } 
 
   b [ n - 1 ] = a [ n - 1 ] [ n - 1 ] ; 
 
   f o r ( i = 0 ; i < n ; i + + )   k q * = b [ i ] ; 
 
   i f ( d e m % 2 = = 0 )   r e t u r n   k q ; 
 
   r e t u r n   - k q ; 
 
 } 
 
 f l o a t   c o n ( f l o a t   a [ ] [ 1 0 0 ] , i n t   n , i n t   h , i n t   c ) 
 
 { 
 
   f l o a t   b [ 1 0 0 ] [ 1 0 0 ] ; 
 
   i n t   i , j , x = - 1 , y ; 
 
   f o r ( i = 0 ; i < n ; i + + ) 
 
   { 
 
     i f ( i = = h )   c o n t i n u e ; 
 
     x + + ; y = - 1 ; 
 
     f o r ( j = 0 ; j < n ; j + + ) 
 
     { 
 
       i f ( j = = c ) c o n t i n u e ; 
 
       y + + ; 
 
       b [ x ] [ y ] = a [ i ] [ j ] ; 
 
     } 
 
   } 
 
   i f ( ( h + c ) % 2 = = 0 )   r e t u r n   d e t ( b , n - 1 ) ; 
 
   r e t u r n   - d e t ( b , n - 1 ) ; 
 
 } 
 
 v o i d   n g h i c h d a o ( f l o a t   a [ ] [ 1 0 0 ] , i n t   n ) 
 
 { 
 
   f l o a t   b [ 1 0 0 ] [ 1 0 0 ] ; 
 
   f o r ( i n t   i = 0 ; i < n ; i + + ) 
 
   { 
 
     f o r ( i n t   j = 0 ; j < n ; j + + ) 
 
     { 
 
       b [ i ] [ j ] = c o n ( a , n , i , j ) ; 
 
     } 
 
   } 
 
   f o r ( i n t   i = 0 ; i < n - 1 ; i + + ) 
 
     f o r ( i n t   j = i + 1 ; j < n ; j + + ) 
 
     { 
 
       f l o a t   t = b [ i ] [ j ] ; 
 
       b [ i ] [ j ] = b [ j ] [ i ] ; 
 
       b [ j ] [ i ] = t ; 
 
     } 
 
   f l o a t   k = d e t ( a , n ) ; 
 
   f o r ( i n t   i = 0 ; i < n ; i + + ) 
 
     f o r ( i n t   j = 0 ; j < n ; j + + ) 
 
       b [ i ] [ j ] / = k ; 
 
   i f ( k = = 0 )   c o u t < < " \ n k h o n g   c o   m a   t r a n   n g h i c h   d a o ! " ; 
 
   e l s e   x u a t ( b , n ) ; 
 
 } 
 
 
 
 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 # i n c l u d e < i o s t r e a m . h > 
 
 # i n c l u d e < c o n i o . h > 
 
 # i n c l u d e < m a t h . h > 
 
 # d e f i n e   m a x   1 0 
 
 v o i d   n h a p m t ( i n t   a [ m a x ] [ m a x ] ,   i n t   m ,   i n t   n ) 
 
 { 
 
 i n t   i , j ; 
 
 f o r ( i = 0 ; i < m ; i + + ) 
 
 { 
 
 f o r ( j = 0 ; j < m ; i + + ) 
 
 { 
 
 c o u t < < " m o i   b a n   n h a p   m a   t r a n   a : \ n " ; 
 
 c o u t < < "   n h a p   v a o   g i a   t r i   h a n g   M   :   " ;   c i n > > m ; 
 
 c o u t < < "   n h a p   v a o   g i a   t r i   c o t   N   :   " ;   c i n > > n ; 
 
 } 
 
 } 
 
 } 
 
 / *   h a m   k i e m   t r a   m a   t r a n   d o i   x u n g * / 
 
 v o i d   k i e m t r a ( i n t   a [ m a x ] [ m a x ] ,   i n t m ,   i n t   n ) 
 
 { 
 
 i n t   i , j ; 
 
 i n t   f l a g = 1 ; 
 
 f o r ( i = 0 ; i < m ; i + + ) 
 
 { 
 
 f o r ( j = 0 ; j < n ; j + + ) 
 
 { 
 
 i f ( a [ i ] [ j ] ! = a [ j ] [ i ] ) 
 
 f l a g = 0 ; b r e a k ; 
 
 } 
 
 } 
 
 i f ( f l a g = = 0 ) 
 
 c o u t < < "   m a   t r a n   k h o n g   d o i   x u n g " ; 
 
 e l s e 
 
 c o u t < < " m a   t r a n   d o i   x u n g " ; 
 
 { 
 
 r e t u r n   0 ; 
 
 } 
 
 v o i d   x u a t ( i n t   a [ m a x ] [ m a x ] ,   i n t   m ,   i n t   n ) 
 
 { 
 
 i n t   i ,   j ; 
 
 f o r ( i = 0 ; i < m ; i + + ) 
 
 { 
 
 f o r ( j = 0 ; j < m ; j + + ) 
 
 { 
 
 c o u t < < "     " < < a [ i ] [ j ] ; 
 
 } 
 
 c o u t < < " \ n " ; 
 
 } 
 
 } 
 
 
 
 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 # i n c l u d e < s t d i o . h > 
 
 # i n c l u d e < c o n i o . h > 
 
 # i n c l u d e < m a t h . h > 
 
 # i n c l u d e < s t r i n g . h > 
 
 i n t   n h a p m a t r a n ( i n t   a [ 1 0 0 ] [ 1 0 0 ] , i n t   n ) 
 
 { 
 
         i n t   i , j ; 
 
         f o r ( i = 1 ; i < = n ; i + + ) 
 
         f o r ( j = 1 ; j < = n ; j + + ) 
 
         { 
 
                 p r i n t f ( " n h a p   p h a n   t u   % d % d   :   " , i , j ) ; 
 
                 s c a n f ( " % d " , & a [ i ] [ j ] ) ; 
 
         } 
 
         r e t u r n   0 ; 
 
 } 
 
 i n t   i n m a t r a n ( i n t   a [ 1 0 0 ] [ 1 0 0 ] , i n t   n ) 
 
 { 
 
         i n t   i , j ; 
 
         f o r ( i = 1 ; i < = n ; i + + ) 
 
         { 
 
                 p r i n t f ( " \ n " ) ; 
 
                 f o r ( j = 1 ; j < = n ; j + + ) 
 
                 p r i n t f ( " % d     " , a [ i ] [ j ] ) ;                         
 
         } 
 
         r e t u r n   0 ; 
 
 } 
 
 i n t   m a i n ( ) 
 
 { 
 
         i n t   a [ 1 0 0 ] [ 1 0 0 ] ; 
 
         i n t   n , m , i , j , t = 0 ; 
 
         p r i n t f ( " n h a p   s o   h a n g   v a   s o   c o t   c u a   m a   t r a n :   " ) ; s c a n f ( " % d " , & n ) ; 
 
         n h a p m a t r a n ( a , n ) ; 
 
         p r i n t f ( " \ n m a   t r a n   v u a   n h a p   l a : \ n " ) ; 
 
         i n m a t r a n ( a , n ) ; 
 
         f o r ( i = 1 ; i < = n ; i + + ) 
 
         f o r ( j = 1 ; j < = n & & i ! = j ; j + + ) 
 
         i f ( a [ i ] [ j ] = = a [ j ] [ i ] ) 
 
         t + + ; 
 
         i f ( t = = n * n - n ) 
 
         p r i n t f ( " m a   t r a n   v u a   n h a p   l a   m a   t r a n   d o i   x u n g " ) ; 
 
         e l s e 
 
         p r i n t f ( " m a   t r a n   v u a   n h a p   k h o n g   p h a i   m a   t r a n   d o i   x u n g " ) ; 
 
         g e t c h ( ) ; 
 
         r e t u r n   0 ; 
 
 } 
 
 
 
 # i n c l u d e < s t d i o . h > 
 
 # i n c l u d e < c o n i o . h > 
 
   
 
 v o i d   m a i n ( ) 
 
 { 
 
         i n t   i , j , k , n ,   s i g n   =   1 ; 
 
         d o u b l e   d e t   =   1 ;   d o u b l e   t e m p ; 
 
         d o u b l e   a [ 1 0 ] [ 1 0 ] , b [ 1 0 ] [ 1 0 ] ; 
 
 / /   N h a p   c a p   c u a   m a   t r a n : 
 
         p r i n t f ( " \ n C a p   c u a   m a   t r a n   v u o n ,   n   =   " ) ;   s c a n f ( " % d " , & n ) ; 
 
   
 
 / /   N h a p   m a   t r a n   a : 
 
         f o r   ( i   =   0 ;   i   <   n ;   i + + ) 
 
                 f o r   ( j   =   0 ;   j   <   n ;   j + + ) 
 
                         { 
 
                                 p r i n t f ( " a [ % d ] [ % d ]   =   " ,   i ,   j ) ; 
 
                                 s c a n f ( " % l f " , & a [ i ] [ j ] ) ; 
 
                         } 
 
   
 
 / /   T i n h   d i n h   t h u c   c u a   a 
 
         f o r   ( i   =   0 ;   i   <   n - 1 ;   i + + ) 
 
                 { 
 
                         i f   ( a [ i ] [ i ]   = =   0 )   / /   N u   g p   p h n   t   t r  n   n g   c h  o   c h  n h   b n g   0   t h    t  m   h  n g   k h  c     i 
 
                                 { 
 
                                         k   =   i + 1 ; 
 
                                         w h i l e   ( k   <   n   & &   a [ k ] [ i ]   = =   0 )   k + + ; 
 
                                         i f   ( k = = n )   {   p r i n t f ( " \ n d e t ( a )   =   0 " ) ;   b r e a k ; }   / /   K h  n g   t i m g   t h y ,   t c   d e t ( a )   =   0 
 
                                         f o r   ( j   =   i ;   j   <   n ;   j + + ) / /   i   h  n g   i   v i   h  n g   k 
 
                                                 { 
 
                                                         t e m p   =   a [ i ] [ j ] ; 
 
                                                         a [ i ] [ j ]   =   a [ k ] [ j ] ; 
 
                                                         a [ k ] [ j ]   =   t e m p ; 
 
                                                 } 
 
                                         s i g n   =   - s i g n ;   / /   n h   t h c   i   d u    
 
                                 } 
 
                         f o r   ( j   =   i + 1 ;   j   <   n ;   j + + ) / /   B i n   i     c  c   p h n   t   c  n g   c t     h  n g   d i   b n g   0    
 
                                 { 
 
                                         t e m p   =   - a [ j ] [ i ] / a [ i ] [ i ] ; 
 
                                         f o r   ( k   =   i + 1 ;   k   <   n ;   k + + )       a [ j ] [ k ]   + =   t e m p * a [ i ] [ k ] ;   / /   N h  n   h  n g   i   v i   ( - a [ j ] [ i ] / a [ i ] [ i ] )   r i   c n g   v  o   h  n g   j 
 
                                 } 
 
                         d e t   * =   a [ i ] [ i ] ;   / /   T  n h   d n   d e t ( a ) 
 
                 } 
 
   
 
         d e t   * =   a [ n - 1 ] [ n - 1 ] ;   / /   N h  n   v i   p h n   t   c u i   c h  o   c h  n h   n a   l    x o n g 
 
         p r i n t f ( " \ n d e t ( a )   =   % l f \ n " , d e t ) ; 
 
   
 
 / / T i n h   m a   t r a n   n g u o c 
 
 i f   ( d e t   ! =   0 ) 
 
 { 
 
         f o r   ( i   =   0 ;   i   <   n ;   i + + )   / /   T o   r a   b   l    m a   t r n   n   v    
 
                 f o r   ( j   =   0 ;   j   <   n ;   j + + ) 
 
                 i f   ( i = = j )   b [ i ] [ j ]   =   1 ;   e l s e   b [ i ] [ j ]   =   0 ; 
 
   
 
         f o r   ( i   =   0 ;   i   <   n ;   i + + )   / /   X   l    t   h  n g   u   n   h  n g   c u i 
 
                 { 
 
                         i f   ( a [ i ] [ i ]   = =   0 )   / /   N u   g p   p h n   t   t r  n   n g   c h  o   c h  n h   b n g   0   t h    i   h  n g 
 
                                 { 
 
                                         k   =   i + 1 ; 
 
                                         w h i l e   ( k   <   n   & &   a [ k ] [ i ]   = =   0 )   k + + ; 
 
                                         f o r   ( j   =   0 ;   j   <   n ;   j + + )   / /   i   h  n g      c a   a    ,   c   v i   m a   t r n   b   n a 
 
                                                 { 
 
                                                         t e m p   =   a [ i ] [ j ] ; 
 
                                                         a [ i ] [ j ]   =   a [ k ] [ j ] ; 
 
                                                         a [ k ] [ j ]   =   t e m p ; 
 
                                                         t e m p   =   b [ i ] [ j ] ; 
 
                                                         b [ i ] [ j ]   =   b [ k ] [ j ] ; 
 
                                                         b [ k ] [ j ]   =   t e m p ; 
 
                                                 } 
 
                                 } 
 
   
 
                         t e m p   =   a [ i ] [ i ] ; 
 
                         f o r   ( j   =   i ;   j   <   n ;   j + + )   a [ i ] [ j ]   / =   t e m p ; 
 
                         f o r   ( j   =   0 ;   j   <   n ;   j + + )   b [ i ] [ j ]   / =   t e m p ; 
 
   
 
                         f o r   ( j   =   i + 1 ;   j   <   n ;   j + + ) 
 
                                 { 
 
                                         t e m p   =   - a [ j ] [ i ] ; 
 
                                         f o r   ( k   =   i ;   k   <   n ;   k + + )   a [ j ] [ k ]   + =   t e m p * a [ i ] [ k ] ; 
 
                                         f o r   ( k   =   0 ;   k   <   n ;   k + + )   b [ j ] [ k ]   + =   t e m p * b [ i ] [ k ] ; 
 
                                 } 
 
                 } / /   K t   t h  c   q u    t r  n h   G a u s s 
 
   
 
         f o r   ( i   =   n - 1 ;   i   >   0 ;   i - - )   / /   B t   u   q u    t r  n h   J o r d a n 
 
                 f o r   ( j   =   i - 1 ;   j   > = 0 ;   j - - ) 
 
                         { 
 
                                 t e m p   =   - a [ j ] [ i ] ; 
 
                                 f o r   ( k   =   n - 1 ;   k   > =   i ;   k - - )     a [ j ] [ k ]   + =   t e m p * a [ i ] [ k ] ; 
 
                                 f o r   ( k   =   0 ;   k   <   n ;   k + + )   b [ j ] [ k ]   + =   t e m p * b [ i ] [ k ] ; 
 
                         } 
 
   
 
         f o r   ( i   =   0 ;   i   <   n ;   i + + ) / /   I n   r a   m a   t r n   b ,   b  y   g i   l    m a   t r n   n g h i c h   o   c a   a 
 
                 { 
 
                         f o r   ( j   =   0 ;   j   <   n ;   j + + )   p r i n t f ( " % 8 . 3 l f \ t " ,   b [ i ] [ j ] ) ; 
 
                         p r i n t f ( " \ n " ) ; 
 
                 } 
 
 } 
 
 e l s e   p r i n t f ( " \ n K h o n g   c o   m a   t r a n   n g h i c h   d a o \ n " ) ; 
 
         g e t c h ( ) ; 
 
 } 
 
 
 
 / / /   T o n g   h o p   c o d e   v e   m a   t r a n 
 
 / / C  c h   1 :   N h p   m ,   n   t r o n g   h  m 
 
 v o i d   I n p u t M a t r i x ( i n t   a [ ] [ 2 0 ] ,   i n t   & m ,   i n t   & n ) 
 
 { 
 
       p r i n t f ( " N h p   s   h  n g   m :   " ) ; 
 
       s c a n f ( " % d " ,   & m ) ; 
 
       p r i n t f ( " N h p   s   c t   n :   " ) ; 
 
       s c a n f ( " % d " ,   & n ) ; 
 
       f o r ( i n t   i   =   0 ;   i   <   m ;   i + + ) 
 
             f o r ( i n t   j   =   0 ;   j   <   n ;   j + + ) 
 
             { 
 
                   p r i n t f ( " A [ % d ] [ % d ]   =   " ,   i ,   j ) ; 
 
                   s c a n f ( " % d " ,   & a [ i ] [ j ] ) ; 
 
             } 
 
 } 
 
   
 
 / / C  c h   2 :   N h p   m ,   n   n g o  i   h  m 
 
 v o i d   I n p u t M a t r i x ( i n t   a [ ] [ 2 0 ] ,   i n t   m ,   i n t   n ) 
 
 { 
 
       f o r ( i n t   i   =   0 ;   i   <   m ;   i + + ) 
 
             f o r ( i n t   j   =   0 ;   j   <   n ;   j + + ) 
 
             { 
 
                   p r i n t f ( " A [ % d ] [ % d ]   =   " ,   i ,   j ) ; 
 
                   s c a n f ( " % d " ,   & a [ i ] [ j ] ) ; 
 
             } 
 
 } 
 
 
 
 v o i d   O u t p u t M a t r i x ( i n t   a [ ] [ 2 0 ] ,   i n t   m ,   i n t   n ) 
 
 { 
 
       f o r ( i n t   i   =   0 ;   i   <   m ;   i + + ) 
 
       { 
 
             f o r ( i n t   j   =   0 ;   j   <   n ;   j + + ) 
 
                   p r i n t f ( " % d \ t " ,   a [ i ] [ j ] ) ; 
 
             p r i n t f ( " \ n " ) ; 
 
       } 
 
 } 
 
 
 
 v o i d   D e l e t e R o w ( i n t   a [ ] [ 2 0 ] ,   i n t   & m ,   i n t   n ,   i n t   i n d e x R o w ) 
 
 { 
 
       f o r ( i n t   i = i n d e x R o w ; i < m - 1 ; i + + ) 
 
             f o r ( i n t   j = 0 ; j < n ; j + + ) 
 
                   a [ i ] [ j ] = a [ i + 1 ] [ j ] ; 
 
       m - - ; 
 
 } 
 
   
 
 v o i d   D e l e t e C o l u m n ( i n t   a [ ] [ 2 0 ] ,   i n t   m ,   i n t   & n ,   i n t   i n d e x C o l u m n ) 
 
 { 
 
       f o r ( i n t   i = 0 ; i < m ; i + + ) 
 
             f o r ( i n t   j = i n d e x C o l u m n ; j < n - 1 ; j + + ) 
 
                   a [ i ] [ j ] = a [ i ] [ j + 1 ] ; 
 
       n - - ; 
 
 } 
 
 
 
 v o i d   D e l e t e R o w C o l u m n ( i n t   a [ ] [ 2 0 ] ,   i n t   & m ,   i n t   & n , 
 
                                                             i n t   i n d e x R o w ,   i n t   i n d e x C o l u m n ) 
 
 { 
 
       f o r ( i n t   i = 0 ; i < m ; i + + ) 
 
             f o r ( i n t   j = 0 ; j < n ; j + + ) 
 
             { 
 
                   i f ( i < i n d e x R o w   & &   j > = i n d e x C o l u m n ) 
 
                         a [ i ] [ j ] = a [ i ] [ j + 1 ] ; 
 
                   e l s e   i f ( i > = i n d e x R o w   & &   j < i n d e x C o l u m n ) 
 
                         a [ i ] [ j ] = a [ i + 1 ] [ j ] ; 
 
                   e l s e   i f ( i > = i n d e x R o w   & &   j > = i n d e x C o l u m n ) 
 
                         a [ i ] [ j ] = a [ i + 1 ] [ j + 1 ] ; 
 
             } 
 
       m - - ; 
 
       n - - ; 
 
 } 
 
 v o i d   s w a p ( i n t   & a ,   i n t   & b ) 
 
 { 
 
       i n t   t e m p   =   a ; 
 
       a   =   b ; 
 
       b   =   t e m p ; 
 
 } 
 
   
 
 v o i d   s w a p R o w ( i n t   a [ ] [ 2 0 ] ,   i n t   m ,   i n t   n ,   i n t   r o w 1 ,   i n t   r o w 2 ) 
 
 { 
 
       i f ( ( r o w 1 > = 0   & &   r o w 1 < m ) & & ( r o w 2 > = 0   & &   r o w 2 < m ) ) 
 
             f o r ( i n t   j = 0 ; j < n ; j + + ) 
 
                   s w a p ( a [ r o w 1 ] [ j ] , a [ r o w 2 ] [ j ] ) ; 
 
 } 
 
   
 
 v o i d   s w a p C o l u m n ( i n t   a [ ] [ 2 0 ] ,   i n t   m ,   i n t   n ,   i n t   c o l u m n 1 ,   i n t   c o l u m n 2 ) 
 
 { 
 
       i f ( ( c o l u m n 1 > = 0   & &   c o l u m n 1 < n ) & & ( c o l u m n 2 > = 0   & &   c o l u m n 2 < n ) ) 
 
             f o r ( i n t   i = 0 ; i < m ; i + + ) 
 
                   s w a p ( a [ i ] [ c o l u m n 1 ] , a [ i ] [ c o l u m n 2 ] ) ; 
 
 } 
 
 
 
 i n t   S u m ( i n t   a [ ] [ 2 0 ] ,   i n t   m ,   i n t   n ) 
 
 { 
 
       i n t   s u m   =   0 ; 
 
       f o r ( i n t   i   =   0 ;   i   <   m ;   i + + ) 
 
       { 
 
             s u m   + =   a [ i ] [ 0 ] ; 
 
             s u m   + =   a [ i ] [ n - 1 ] ; 
 
       } 
 
       f o r ( i n t   j   =   0 ;   j   <   n ;   j + + ) 
 
       { 
 
             s u m   + =   a [ 0 ] [ i ] ; 
 
             s u m   + =   a [ n - 1 ] [ i ] ; 
 
       } 
 
       r e t u r n   s u m ; 
 
 } 
 
 v o i d   I n d e x O f M a x ( i n t   a [ ] [ 2 0 ] ,   i n t   m ,   i n t   n ) 
 
 { 
 
       i n t   i M a x   =   0 ,   j M a x   =   0 ; 
 
       f o r ( i n t   i   =   0 ;   i   <   m ;   i + + ) 
 
             f o r ( i n t   j   =   0 ;   j   <   n ;   j + + ) 
 
                   i f ( a [ i ] [ j ] > a [ i M a x ] [ j M a x ] ) 
 
                   { 
 
                         i M a x   =   i ; 
 
                         j M a x   =   j ; 
 
                   } 
 
 } 
 
 i n t   S u m ( i n t   a [ ] [ 2 0 ] ,   i n t   n ) 
 
 { 
 
       i n t   s u m   =   0 ; 
 
       f o r ( i n t   i   =   0 ;   i   <   n ;   i + + ) 
 
             s u m   + =   a [ i ] [ i ] ; 
 
       r e t u r n   s u m ; 
 
 } 
 
 / / T  m   m a x 
 
 i n t   M a x ( i n t   a [ ] [ 2 0 ] ,   i n t   n ) 
 
 { 
 
       i n t   m a x   =   a [ 0 ] [ 0 ] ; 
 
       f o r ( i n t   i   =   1 ;   i   <   n ;   i + + ) 
 
             i f ( a [ i ] [ i ]   >   m a x ) 
 
                   m a x   =   a [ i ] [ i ] ; 
 
       r e t u r n   m a x ; 
 
 } 
 
   
 
 / / T  m   m i n 
 
 i n t   M i n ( i n t   a [ ] [ 2 0 ] ,   i n t   n ) 
 
 { 
 
       i n t   m i n   =   a [ 0 ] [ 0 ] ; 
 
       f o r ( i n t   i   =   1 ;   i   <   n ;   i + + ) 
 
             i f ( a [ i ] [ i ]   <   m i n ) 
 
                   m i n   =   a [ i ] [ i ] ; 
 
       r e t u r n   m i n ; 
 
 } 
 
 i n t   S u m ( i n t   a [ ] [ 2 0 ] ,   i n t   n ) 
 
 { 
 
       i n t   s u m   =   0 ; 
 
       f o r ( i n t   i   =   0 ;   i   <   n ;   i + + ) 
 
             s u m   + =   a [ i ] [ n - 1 - i ] ; 
 
       r e t u r n   s u m ; 
 
 } 
 
   
 
 / / C  c h   k h  c 
 
 i n t   S u m ( i n t   a [ ] [ 2 0 ] ,   i n t   n ) 
 
 { 
 
       i n t   s u m   =   0 ; 
 
       f o r ( i n t   i   =   0 ,   j   =   n - 1 ;   i   <   n ;   i + + ,   j - - ) 
 
             s u m   + =   a [ i ] [ j ] ; 
 
       r e t u r n   s u m ; 
 
 } 
 
 i n t   I s S y m m e t r i c ( i n t   a [ ] [ 2 0 ] ,   i n t   n ) 
 
 { 
 
       f o r ( i n t   i   =   0 ;   i   <   n ;   i + + ) 
 
             f o r ( i n t   j   =   0 ;   j   <   i ;   j + + ) 
 
                   i f ( a [ i ] [ j ]   ! =   a [ j ] [ i ] ) 
 
                         r e t u r n   0 ; 
 
       r e t u r n   1 ; 
 
 } 
 
 v o i d   s w a p ( i n t   & a ,   i n t   & b ) 
 
 { 
 
       i n t   t e m p   =   a ; 
 
       a   =   b ; 
 
       b   =   t e m p ; 
 
 } 
 
 v o i d   T r a n s p o s e ( i n t   a [ ] [ 2 0 ] ,   i n t   n ) 
 
 { 
 
       f o r ( i n t   i   =   0 ;   i   <   n ;   i + + ) 
 
             f o r ( i n t   j   =   0 ;   j   <   i ;   j + + ) 
 
                   s w a p ( a [ i ] [ j ] ,   a [ j ] [ i ] ) ; 
 
 } 
 
 
 
 
 
 
 
 